home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / ikHandleValues.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.9 KB  |  146 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //    MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //    Creation Date:    Jan. 6, 1997
  22. //    Author:            ap
  23. //
  24. //    Description:    initializes ikHandleContext tool property sheet
  25. //                    values
  26. //
  27. //    Input Arguments:
  28. //        toolName  - this is the name of the instance of the tool
  29. //                    that the property sheet is modifying.
  30. //
  31. //    Return Value:
  32. //        None.
  33. //
  34.  
  35.  
  36. global proc ikHandleHOptionValues( string $toolName, string $ctxCmd )
  37. {
  38.     string    $current;
  39.     int        $set;
  40.     int        $autoPriorityFlag;
  41.  
  42.     //  current solver (option menu)
  43.     string  $solvertype = eval($ctxCmd + " -q -solverTypeH " + $toolName);
  44.     string  $solverItems[] = `optionMenuGrp -q -ils ikHandleHOptionMenu`;
  45.     string  $menuItemValue;
  46.     int     $i;
  47.     for( $i = 0; $i < size($solverItems); $i++ )
  48.     {
  49.         $menuItemValue = `menuItem -q -l $solverItems[$i]`;
  50.         if ($menuItemValue == $solvertype)
  51.             optionMenuGrp -e -sl ($i+1) ikHandleHOptionMenu;
  52.     }
  53.     clear($solverItems);
  54.  
  55.     //  auto priority check box
  56.     //
  57.     $set = eval($ctxCmd + " -q -autoPriorityH " + $toolName);
  58.     if ($set) {
  59.         checkBoxGrp -e -value1 1 autoPriorityGrp;
  60.         $autoPriorityFlag = false;
  61.     }
  62.     else {
  63.         checkBoxGrp -e -value1 0 autoPriorityGrp;
  64.         $autoPriorityFlag = true;
  65.     }
  66.  
  67.     //  snap handle
  68.     $set = eval($ctxCmd + " -q -snapHandleH " + $toolName);
  69.     if ($set) {
  70.         checkBoxGrp -e -value1 1 snapHandleGrp;
  71.     }
  72.     else {
  73.         checkBoxGrp -e -value1 0 snapHandleGrp;
  74.     }
  75.  
  76.     //  force solver
  77.     $set = eval($ctxCmd + " -q -forceSolverH " + $toolName);
  78.     if ($set) {
  79.         checkBoxGrp -e -value1 1 forceSolverGrp;
  80.     }
  81.     else {
  82.         checkBoxGrp -e -value1 0 forceSolverGrp;
  83.     }
  84.  
  85.     //=====================================================
  86.     // For maya1.0, there is not superSticky yet. So in UI,
  87.     // use checkBox to turn on/off sticky.
  88.     //
  89.     // Use radioButtonGrp when implementing superSticky.
  90.     //=====================================================
  91.     //  stickies
  92.     $current = eval($ctxCmd + " -q -stickyH " + $toolName);
  93.     if ($current == "sticky") {
  94.         //radioButtonGrp -e -select 2 stickyGrp;
  95.         checkBoxGrp -e -value1 1 stickyGrp;
  96.     }
  97.     //else if ($current == "superSticky") {
  98.     //  radioButtonGrp -e -select 3 stickyGrp;
  99.     //}
  100.     else {
  101.         //radioButtonGrp -e -select 1 stickyGrp;
  102.         checkBoxGrp -e -value1 0 stickyGrp;
  103.     }
  104.  
  105.     //  priority
  106.     $set = eval($ctxCmd + " -q -priorityH " + $toolName);
  107.     intSliderGrp -e
  108.         -value $set
  109.         -enable $autoPriorityFlag
  110.         priority;
  111.  
  112.     //  weight
  113.     $fv = eval($ctxCmd + " -q -weightH " + $toolName);
  114.     floatSliderGrp -e
  115.         -value $fv
  116.         handleWeight;
  117.  
  118.     //  poweight
  119.     $fv = eval($ctxCmd + " -q -poWeightH " + $toolName);
  120.     floatSliderGrp -e
  121.         -value $fv
  122.         handlePOWeight;
  123.  
  124.     return;
  125. }
  126.  
  127. global proc ikHandleValues( string $toolName ) {
  128.  
  129.     string    $parent = (`toolPropertyWindow -q -location` + "|ikHandle");
  130.     setParent    $parent;
  131.  
  132.     string $icon = "kinHandle.xpm";
  133.     string $helpTag = "IKHandleTool";
  134.     toolPropertySetCommon $toolName $icon $helpTag;
  135.  
  136.     frameLayout -e -en true -cl false ikHandleHFrame;
  137.     ikHandleHOptionValues( $toolName, "ikHandleCtx");
  138.  
  139.     toolPropertySelect ikHandle;
  140.  
  141.     return;
  142. }
  143.  
  144.  
  145.  
  146.